/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function Ajax(){
          
          this.owrAjax = function(rate){
             
            var rar         = rate;
            var ratename    = $("#"+rar).val();
            var useridrate  = $("#useridrate").val();
            var connidrate  = $("#connidrate").val();
            var dataString  = 'ratename=' + ratename + '&useridrate=' + useridrate + '&connidrate=' + connidrate ;

            if(ratename=='' || useridrate=='' || connidrate=='')
            {
                $('.successr').fadeOut(200).hide();
                $('.errorr').fadeOut(200).show();
            }
            else
            {
                $.ajax({
                    type: "POST",
                    url: "templates/formhandler.php",
                    data: dataString,
                    success: function(){
                        
                        $('.successr').fadeIn(200).show();
                        $('.errorr').fadeOut(200).hide();
                        $('#showrate').load('templates/showrating.php?id='+connidrate);
                    }
                });
            }
            return false;

                    }
          
      } 
      
      var ajax = new Ajax;